package com.hc.demo.service;

import com.hc.demo.dto.ResultResponse;
import com.hc.demo.mapper.HospitalMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HospitalServiceImpl implements HospitalService {
    @Autowired
    HospitalMapper hospitalMapper;

    @Override
    public ResultResponse list(){
        return new ResultResponse(ResultResponse.SUCCESS_CODE,ResultResponse.SUCCESS_DESC,hospitalMapper.selectByState(1));
    }

    @Override
    public ResultResponse selectOneById(Integer hpId) {
        return new ResultResponse(ResultResponse.SUCCESS_CODE,ResultResponse.SUCCESS_DESC,hospitalMapper.selectByPrimaryKey(hpId));
    }
}
